﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

	//union Un1
	//{
	//	char c[5];
	//	int i;
	//};
	//union Un2
	//{
	//	short c[7];
	//	int i;
	//};
	//int main()
	//{
	//	//下⾯输出的结果是什么？
	//	printf("%d\n", sizeof(union Un1));
	//	printf("%d\n", sizeof(union Un2));

	//return 0;
 //   }


 //
int main()
{
struct S1
{
	char c1;
	int i;
	char c2;
};
printf("%d\n", sizeof(struct S1));

struct S2
{
	char c1;
	char c2;
	int i;
};
printf("%d\n", sizeof(struct S2));
//练习3
struct S3
{
	double d;
	char c;
	int i;
};
printf("%d\n", sizeof(struct S3));
//练习4结构体嵌套问题

struct S4
{
	char c1;
	struct S3 s3;
	double d;
};
printf("%d\n", sizeof(struct S4));
return 0;
}



